<?php
class ModPlayersOnline
{
	public function index()
	{
		$info = new OTS_ServerInfo( configParser::getData('ip'), configParser::getData('port') );
		$status = $info->info(OTS_ServerStatus::RESPOND_EXT_PLAYERS_INFO);
		
		if( !$status )
			viewLayer::render( NULL, 'Server is offline.' );
		else
		{	
			viewLayer::$var->playersList = $status->getPlayers();
			viewLayer::render('playersonline');
		}
	}
}
?>